﻿using IBll;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace Web612.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RecipeController : ControllerBase, IRecipeBll
    {
         public RecipeController(IRecipeBll bll)
        {
            Bll = bll;
        }

        public IRecipeBll Bll { get; }

        [HttpPost]
        public Task<int> AddAnync(Recipe recipe)
        {
            return Bll.AddAnync(recipe);
        }

        [HttpGet]
        public dynamic Show(string? name, int classificationId = -1)
        {
            return Bll.Show(name, classificationId);

        }



    }
}
